package com.xuxin.nantai.presenter;

import com.xuxin.nantai.bean.BaseBean;
import com.xuxin.nantai.bean.SelectDefectBean;
import com.xuxin.nantai.contract.SelectDefectContract;
import com.xuxin.nantai.model.SelectDefectModel;

/**
 * Created by xu_xin
 * Created on 2020.06.17 0017
 */
public class SelectDefectPresenter implements SelectDefectContract.Presenter {
    private SelectDefectModel model;
    private SelectDefectContract.View view;

    public SelectDefectPresenter(SelectDefectContract.View view) {
        model = new SelectDefectModel();
        this.view = view;
    }

    @Override
    public void getDefect(String Guid, String InsType) {
        if (null != model) {
            model.getDefect(this, Guid, InsType);
        }
    }

    @Override
    public void onSuccess(SelectDefectBean selectDefectBean) {
        if (null != view) {
            view.onSuccess(selectDefectBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}
